<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								：<input type="text" name="createTime"/>
							</li>

							<li>
								：<input type="text" name="creator"/>
							</li>

							<li>
								：<input type="text" name="modifyTime"/>
							</li>

							<li>
								：<input type="text" name="modifier"/>
							</li>

							<li>
								：<input type="text" name="remark"/>
							</li>

							<li>
								省：<input type="text" name="province"/>
							</li>

							<li>
								市：<input type="text" name="city"/>
							</li>

							<li>
								县/区：<input type="text" name="county"/>
							</li>

							<li>
								省市县：<input type="text" name="brief"/>
							</li>

							<li>
								详细地址：<input type="text" name="detail"/>
							</li>

							<li>
								是否默认：<input type="text" name="isdefault"/>
							</li>

							<li>
								用户姓名：<input type="text" name="name"/>
							</li>

							<li>
								电话号码：<input type="text" name="telephone"/>
							</li>

							<li>
								帐号状态（0正常 1停用）：<input type="text" name="status"/>
							</li>

							<li>
								：<input type="text" name="memberId"/>
							</li>

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="treasure:tAddress:add">
					<i class="fa fa-plus"></i> 添加
				</a>
				<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="treasure:tAddress:edit">
					<i class="fa fa-edit"></i> 修改
				</a>
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="treasure:tAddress:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="treasure:tAddress:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('treasure:tAddress:edit')}]];
        var removeFlag = [[${@permission.hasPermi('treasure:tAddress:remove')}]];
        var prefix = ctx + "treasure/tAddress";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "地址",
				search: false,
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'addressId', 
					title : '',
					visible: false
				},
				{
					field : 'createTime', 
					title : '',
					sortable: true
				},
				{
					field : 'creator', 
					title : '',
					sortable: true
				},
				{
					field : 'modifyTime', 
					title : '',
					sortable: true
				},
				{
					field : 'modifier', 
					title : '',
					sortable: true
				},
				{
					field : 'remark', 
					title : '',
					sortable: true
				},
				{
					field : 'province', 
					title : '省',
					sortable: true
				},
				{
					field : 'city', 
					title : '市',
					sortable: true
				},
				{
					field : 'county', 
					title : '县/区',
					sortable: true
				},
				{
					field : 'brief', 
					title : '省市县',
					sortable: true
				},
				{
					field : 'detail', 
					title : '详细地址',
					sortable: true
				},
				{
					field : 'isdefault', 
					title : '是否默认',
					sortable: true
				},
				{
					field : 'name', 
					title : '用户姓名',
					sortable: true
				},
				{
					field : 'telephone', 
					title : '电话号码',
					sortable: true
				},
				{
					field : 'status', 
					title : '帐号状态（0正常 1停用）',
					sortable: true
				},
				{
					field : 'memberId', 
					title : '',
					sortable: true
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.addressId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.addressId + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>